<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>


<script>

    var datalog = [10,30,30,40,50];
    var canvas = d3.select("body")
                  .append("svg")
                  .attr("width",500)
                  .attr("height",500);

    var circle1 = canvas.append("circle")
                         .attr("cx",50)
                         .attr("cy",120)
                         .attr("r",20);
    var circle2 = canvas.append("circle")
                         .attr("cx",50)
                         .attr("cy",160)
                         .attr("r",20);

    var circles = canvas.selectAll("circle")
                      .data(datalog)
                      .attr("fill","red")
                      .exit()
                        .attr("fill","blue");
                      <!--.enter()-->
                         <!--.append("circle")-->
                         <!--.attr("cx",50)-->
                         <!--.attr("cy",50)-->
                         <!--.attr("fill","blue")-->
                         <!--.attr("r",20);-->





</script>

</body>
</html>